


obj-m += led-digital.o
obj-m += osw-glink.o


MODULE_INSTALDIR ?= /lib/modules/$(shell uname -r)/kernel/drivers/net/usb
KERNELDIR = /work/EasyArm/linux-2.6.35.3
#KERNELDIR = ~/home/work/EasyArm/linux-2.6.35.3/
KERNELDIR = /work/EasyArm/linux-imx/
#KERNELDIR = ~/home/work/dvd-loongson/linux-3.10-git
# KERNELDIR = /work/forlinx/linux-4.1.15
PWD       := $(shell pwd)


# 龙芯内核才使用否则在
# #include "linux/platform_device.h"
# 会出错code model kernel does not support PIC mode
#KBUILD_CFLAGS += -fno-pie
KBUILD_CFLAGS += -g 

default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) -j4 
	cp *.ko /nfs/

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

install:
	# modprobe -r glink-class
	# install -c -m 0644 glink-class.ko $(MODULE_INSTALDIR)
	depmod -a -e

#depend .depend dep:
#	$(CC) $(CFLAGS) -M *.c > .depend


#ifeq (.depend,$(wildcard .depend))
#include .depend
#endif
